<?php
// +----------------------------------------------------------------------
// | tpapi.
// +----------------------------------------------------------------------
// | FileName: Factory.php
// +----------------------------------------------------------------------
// | Author: King east <1207877378@qq.com>
// +----------------------------------------------------------------------


namespace ke\thinkApi;



use ke\thinkApi\src\FastAction;
use ke\thinkApi\src\Setting;

/**
 * Class Factory
 * @package ke\thinkApi
 */
class Factory
{
    private static $handle = [];

    /**
     * @param string $name
     * @param Setting|null $setting
     * @return FastAction
     */
    public static function create($name, Setting $setting = null)
    {
        if (!isset(static::$handle[$name])) {
            static::$handle[$name] = new FastAction($name, $setting);
        }
        return static::$handle[$name];
    }

}